/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package swa.e_store.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Stefan
 */

@Entity
@Table (name = "purchaseItem")
@NamedQueries({
    // select * from purchaseItem p where p.purchaseId = 3;
    @NamedQuery(name = "purchaseItem.findByPurchaseId", query = "SELECT p FROM PurchaseItem p WHERE p.purchaseId = :purchaseId"),
})
public class PurchaseItem {
    
    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column (name = "id")
    private int id;
    
    @Column (name = "purchaseId")
    private int purchaseId;
    
    @Column (name = "artNbr")
    private int artNbr;
    
    @Column (name = "quantity")
    private int quantity;
    
    @Column (name = "unitPrice")
    private float unitPrice;
    
    @Column (name = "lineamount")
    private float lineamount;
    
    //Constructors
    public PurchaseItem(){
        
    }
    
    public PurchaseItem(int artNbr, int quantity){
        
        this.artNbr = artNbr;
        this.quantity = quantity;
        
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the purchaseId
     */
    public int getPurchaseId() {
        return purchaseId;
    }

    /**
     * @param purchaseId the purchaseId to set
     */
    public void setPurchaseId(int purchaseId) {
        this.purchaseId = purchaseId;
    }

    /**
     * @return the artNbr
     */
    public int getArtNbr() {
        return artNbr;
    }

    /**
     * @param artNbr the artNbr to set
     */
    public void setArtNbr(int artNbr) {
        this.artNbr = artNbr;
    }

    /**
     * @return the quantity
     */
    public int getQuantity() {
        return quantity;
    }

    /**
     * @param quantity the quantity to set
     */
    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    /**
     * @return the unitPrice
     */
    public float getUnitPrice() {
        return unitPrice;
    }

    /**
     * @param unitPrice the unitPrice to set
     */
    public void setUnitPrice(float unitPrice) {
        this.unitPrice = unitPrice;
    }

    /**
     * @return the lineamount
     */
    public float getLineamount() {
        return lineamount;
    }

    /**
     * @param lineamount the lineamount to set
     */
    public void setLineamount(float lineamount) {
        this.lineamount = lineamount;
    }
    
    
}
